package com.ch7_2;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.ArrayList;
import java.util.List;

@Controller
@SpringBootApplication
public class Ch72Application {

	@RequestMapping("/")
	public String index(Model model){
//		Person single = new Person("aa",11);
//		List<Person> list = new ArrayList<>();
//		Person p1 = new Person("xx",11);
//		Person p2 = new Person("yy",22);
//		Person p3 = new Person("zz",33);
//		list.add(p1);
//		list.add(p2);
//		list.add(p3);
//		model.addAttribute("singlePerson",single);
//		model.addAttribute("people",list);
		return "index";
	}

	public static void main(String[] args) {
		SpringApplication.run(Ch72Application.class, args);
	}
}
